package Bfs;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;


public class Car {

	String carId,position;
	int passengerNo;
	boolean onCall; //if the car is going for a call, onCall is true
	String callroute; //the route that the car should follow after a call is assigned to it.
	String currentRoute; // currentRoute that the car follows to drop off the passengers and/or go to a call
	
	
	
	public Car(String carId)
	{
		this.carId = carId;
		this.position = "r0";
		this.passengerNo = 0;
		this.onCall = false;
		this.callroute = "";
		this.currentRoute = "r0";
	}
	

	//To make operations easily with ArrayList, we convert route that comes as a string from the database to ArrayList
	//In database, it should be recorded in this string format: "r1,r2,r3,"
	public ArrayList<String> stringToRoute(String route)
	{
		if(route.equals(""))
		{
			ArrayList<String> r = new ArrayList<String>();
			return r;
		}
		ArrayList<String> r = new ArrayList<String>(Arrays.asList(route.split(",")));
		return r;
	}
	
	
	public String routeToString(ArrayList<String> route)
	{
		String rou="";
		for (String s : route)
		{
			rou+=s+",";
		}
		return rou;
	}
	
	
	public String getCarId() {
		return carId;
	}


	public void setCarId(String carId) {
		this.carId = carId;
	}


	public String getPosition() {
		return position;
	}


	public void setPosition(String position) {
		this.position = position;
	}


	public int getPassengerNo() {
		return passengerNo;
	}


	public void setPassengerNo(int passengerNo) {
		this.passengerNo = passengerNo;
	}


	public boolean isOnCall() {
		return onCall;
	}


	public void setOnCall(boolean onCall) {
		this.onCall = onCall;
	}


	public String getCallRoute() {
		return callroute;
	}


	public void setCallRoute(String route) {
		this.callroute = route;
	}


	public String getCurrentRoute() {
		return currentRoute;
	}


	public void setCurrentRoute(String currentRoute) {
		this.currentRoute = currentRoute;
	}


	
	
	
	
	
}
